{% extends 'template.html' %}
{% load staticfiles %}

{% block username %}
    {{ request.user.username }}
{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h2 class="page-header">主机使用率</h2>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="form-group row">
                            <div class="col-sm-2">
                                <select class="form-control" id="id_project" name="project">
                                </select>
                            </div>
                            <div class="col-sm-2">
                                <select class="form-control" id="id_room" name="room">
                                </select>
                            </div>
                            <button class="btn btn-primary" type="button" onclick="search()">搜索</button>
                            <button class="btn btn-success" type="button" onclick="download()">导出</button>
                        </div>
                    </div>
                    <hr>
                    <div class="col-sm-2">
                        <label>业务类型</label>
                        <input class="form-control column_filter" id="business">
                    </div>
                    <div class="col-sm-2">
                        <label>CPU</label>
                        <input class="form-control column_filter" id="cpu">
                    </div>
                    <div class="col-sm-2">
                        <label>RAM</label>
                        <input class="form-control column_filter" id="ram">
                    </div>
                    <br/><br/><br/><br/>
                    <div class="panel-body">
                        <table id="mytable" class="display" width="100%" cellspacing="0">
                            <thead>
                            <tr>
                                <th style="display: none;">id</th>
                                <th>项目</th>
                                <th>机房</th>
                                <th>业务类型</th>
                                <th>外网IP</th>
                                <th>CPU核数</th>
                                <th>RAM</th>
                                <th>硬盘</th>
                                <th>区服</th>
                                <th>已装服数</th>
                                <th>使用率</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="panel-footer">
                        <a class="btn btn-primary" type="button" href="/assets/host_recover_migration_apply/">迁服 /
                            回收申请</a>
                    </div>
                </div>
            </div>

            <div id="is_superuser" data-is-superuser="{{ is_superuser }}"></div>

        </div>
    </div>
{% endblock %}
{% block bodyjs %}
    <script src="/static/js/select2.min.js"></script>
    <script src="/static/js/jquery.dataTables.min.js"></script>
    <script src="/static/js/dataTables.colVis.js"></script>
    <script src="/static/js/host_usage.js?v=20190906001"></script>
    <!-- showloading.js-->
    <script src="/static/js/showloading.min.js"></script>
{% endblock %}
{% block css %}
    <link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
    <link href="/static/css/dataTables.colVis.css" rel="stylesheet" type="text/css">
    <!-- showloading.css-->
    <link href="/static/css/showloading.css" rel="stylesheet" media="screen">
{% endblock %}
